package grape.attend.rest.clock.form;
import grape.common.rest.form.BaseForm;

import grape.common.rest.validation.props.PropValid;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;
/**
 * <p>
 * 打卡设置表
 * </p>
 *
 * @author yangwei
 * @since 2020-05-08
 */
@PropValid
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@ApiModel(value="打卡设置添加表单对象")
public class ClockCreateForm extends BaseForm {

    private static final long serialVersionUID = 1L;

    @NotEmpty(message="名称不能为空")
    @ApiModelProperty(value = "名称",required = true)
    private String name;

    @NotEmpty(message="打卡类型不能为空")
    @ApiModelProperty(value = "打卡类型，字典id",required = true)
    private String typeDictId;

    @NotNull(message="最多晚到分钟数不能为空")
    @ApiModelProperty(value = "最多晚到分钟数",required = true)
    private Integer lateArriveMax;

    @NotNull(message="最多早走分钟数不能为空")
    @ApiModelProperty(value = "最多早走分钟数",required = true)
    private Integer earlyLeaveMax;

    @NotNull(message="是否下班晚走，第二天可晚到不能为空")
    @ApiModelProperty(value = "是否下班晚走，第二天可晚到",required = true)
    private Boolean isNextDayLate;

    @PropValid.DependCondition(message = "晚走分钟数不能为空", dependProp = "isNextDayLate",ifEqual = "true")
    @ApiModelProperty(value = "晚走分钟数")
    private Integer lateLeave;

    @PropValid.DependCondition(message = "可以晚到分钟数不能为空", dependProp = "isNextDayLate",ifEqual = "true")
    @ApiModelProperty(value = "可以晚到分钟数")
    private Integer lateArrive;

    @ApiModelProperty(value = "备注")
    private String remark;



}
